﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web;

namespace HANS.Utility.Hepler
{
   public  class IOHepler
    {

        /// <summary>
        /// 获取文件实际地址
        /// </summary>
        /// <param name="fileName">文件名</param>
        /// <param name="fileCategory">文件分类</param>
        /// <returns>文件实际地址</returns>
        public  static string GetPhysicalPath(string fileName, string filePath)
        {
            return Path.Combine(HttpContext.Current.Server.MapPath(filePath),
                               Path.GetFileName(fileName));
        }

        /// <summary>
        /// 获取文件相对地址
        /// </summary>
        /// <param name="fileName">文件名</param>
        /// <param name="fileCategory">文件分类</param>
        /// <returns>文件相对地址</returns>
        public  static string GetFileRelativePath(string fileName, string filePath)
        {
            return Path.Combine(filePath, Path.GetFileName(fileName));
        }
    }
}
